From 0e72adf6dd5a6c7105f2b6337a8c9d088e0b3925 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 2 Mar 2020 04:15:39 +0100 Subject: [PATCH] drop: Remove unused convenience APIs With the new event controllers, these are unused. --- docs/reference/gdk/gdk4-sections.txt | 2 - gdk/gdkdrop.c | 91 ---------------------------- gdk/gdkdrop.h | 13 ---- 3 files changed, 106 deletions(-) diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index 9f67fbc889..5011e3fb95 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -775,8 +775,6 @@ gdk_drop_read_async gdk_drop_read_finish gdk_drop_read_value_async gdk_drop_read_value_finish -gdk_drop_read_text_async -gdk_drop_read_text_finish GDK_DRAG diff --git a/gdk/gdkdrop.c b/gdk/gdkdrop.c index 29c33f8ef5..20676937e1 100644 --- a/gdk/gdkdrop.c +++ b/gdk/gdkdrop.c @@ -892,70 +892,6 @@ gdk_drop_read_value_finish (GdkDrop *self, return g_task_propagate_pointer (G_TASK (result), error); } -/** - * gdk_drop_read_text_async: - * @self: a #GdkDrop - * @cancellable: (nullable): optional #GCancellable object, %NULL to ignore. - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function - * - * Asynchronously request the drag operation's contents converted to a string. - * When the operation is finished @callback will be called. You can then - * call gdk_drop_read_text_finish() to get the result. - * - * This is a simple wrapper around gdk_drop_read_value_async(). Use - * that function or gdk_drop_read_async() directly if you need more - * control over the operation. - **/ -void -gdk_drop_read_text_async (GdkDrop *self, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data) -{ - g_return_if_fail (GDK_IS_DROP (self)); - g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - g_return_if_fail (callback != NULL); - - gdk_drop_read_value_internal (self, - G_TYPE_STRING, - gdk_drop_read_text_async, - G_PRIORITY_DEFAULT, - cancellable, - callback, - user_data); -} - -/** - * gdk_drop_read_text_finish: - * @self: a #GdkDrop - * @result: a #GAsyncResult - * @error: a #GError location to store the error occurring, or %NULL to - * ignore. - * - * Finishes an asynchronous read started with - * gdk_drop_read_text_async(). - * - * Returns: (transfer full) (nullable): a new string or %NULL on error. - **/ -char * -gdk_drop_read_text_finish (GdkDrop *self, - GAsyncResult *result, - GError **error) -{ - const GValue *value; - - g_return_val_if_fail (g_task_is_valid (result, self), NULL); - g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gdk_drop_read_text_async, NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - value = g_task_propagate_pointer (G_TASK (result), error); - if (!value) - return NULL; - - return g_value_dup_string (value); -} - static void gdk_drop_do_emit_event (GdkEvent *event, gboolean dont_queue) @@ -1063,30 +999,3 @@ gdk_drop_emit_drop_event (GdkDrop *self, gdk_drop_do_emit_event (event, dont_queue); } -/** - * gdk_drop_has_value: - * @self: a #GdkDrop - * @type: the type to check - * - * Returns whether calling gdk_drop_read_value_async() for @type - * can succeed. - * - * Returns: %TRUE if the data can be deserialized to the given type - */ -gboolean -gdk_drop_has_value (GdkDrop *self, - GType type) -{ - GdkContentFormats *formats; - gboolean ret; - - formats = gdk_content_formats_ref (gdk_drop_get_formats (self)); - formats = gdk_content_formats_union_deserialize_gtypes (formats); - - ret = gdk_content_formats_contain_gtype (formats, type); - - gdk_content_formats_unref (formats); - - return ret; -} - diff --git a/gdk/gdkdrop.h b/gdk/gdkdrop.h index c1990b1d67..0256842d65 100644 --- a/gdk/gdkdrop.h +++ b/gdk/gdkdrop.h @@ -83,19 +83,6 @@ GDK_AVAILABLE_IN_ALL const GValue * gdk_drop_read_value_finish (GdkDrop *self, GAsyncResult *result, GError **error); -GDK_AVAILABLE_IN_ALL -void gdk_drop_read_text_async (GdkDrop *self, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -GDK_AVAILABLE_IN_ALL -char * gdk_drop_read_text_finish (GdkDrop *self, - GAsyncResult *result, - GError **error); - -GDK_AVAILABLE_IN_ALL -gboolean gdk_drop_has_value (GdkDrop *self, - GType type); G_END_DECLS -- 2.30.2